#pragma once
#include"AbstractLayer.h"

class DemoRevoluteJoint :public AbstractLayer
{
public:
	createScene(DemoRevoluteJoint)

	CREATE_FUNC(DemoRevoluteJoint)

	bool init();
	
	void box2DAppReady() override;

	void createCar();

	void createBodies();
	
	virtual void onKeyPressed(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event * event) override;

	virtual void onKeyReleased(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event * event) override;
private:
	b2RevoluteJoint * motor;
	const float MOTOR_SPEED = 3.14 / 10 * 5;
	b2Body* bodyA;
};